package com.nyist.diseasepreventionserver.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Data
@Entity
@Table
public class Role extends Base implements Serializable {

    @Column(length = 12,nullable = false)
    private String powerName;

    /** 角色---权限控制器关系：多对多 .*/
    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name = "RolePower",joinColumns = {@JoinColumn(name = "roleId")},inverseJoinColumns = {@JoinColumn(name = "conId")})
    private List<PowerController> powerControllers;

}
